package(default_visibility = ["//visibility:public"])

load(
    "//tools:defaults.bzl",
    "ng_module",
    "ng_package",
    "ng_test_library",
    "ng_web_test_suite",
)

ng_module(
    name = "youtube-player",
    srcs = glob(
        ["**/*.ts"],
        exclude = [
            "**/*.spec.ts",
            "fake-youtube-player.ts",
        ],
    ),
    module_name = "@angular/youtube-player",
    deps = [
        "@npm//@angular/common",
        "@npm//@angular/core",
        "@npm//@types/youtube",
        "@npm//rxjs",
    ],
)

ng_package(
    name = "npm_package",
    srcs = ["package.json"],
    entry_point = ":public-api.ts",
    entry_point_name = "youtube-player",
    tags = ["release-package"],
    deps = [":youtube-player"],
)

ng_test_library(
    name = "unit_test_sources",
    srcs = ["fake-youtube-player.ts"] + glob(
        ["**/*.spec.ts"],
        exclude = ["**/*.e2e.spec.ts"],
    ),
    deps = [
        ":youtube-player",
        "@npm//@angular/platform-browser",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    deps = [":unit_test_sources"],
)

filegroup(
    name = "source-files",
    srcs = glob(["**/*.ts"]),
)
